Skip to content

Comments

feat: USDT tracing#474

Merged
aapoalas merged 13 commits intomainfrom
feat/usdt-tracing
Sep 1, 2025
Merged

feat: USDT tracing#474
aapoalas merged 13 commits intomainfrom
feat/usdt-tracing

Conversation

@aapoalas
Copy link
Member

@aapoalas aapoalas commented Dec 1, 2024

USDT tracing is a way for programs to statically define "points of interest" for tracing tools like DTrace, perf, bpftrace, SystemTap, and others to hook into. I've been diving into this world lately with the intention of getting better performance feedback from Nova. I now have a working Linux-based USDT system built forked from Oxide Computer's usdt crate, and this PR is then a showcase of how that can then be utilised.

Examples

Tracing constructor calls:

Attaching 4 probes...
usdt:/home/aapoalas/build/nova/target/debug/nova_cli:nova:start_builtin_constructor: ArrayBuffer (73417456)
usdt:/home/aapoalas/build/nova/target/debug/nova_cli:nova:stop_builtin_constructor: ArrayBuffer (73426856)
usdt:/home/aapoalas/build/nova/target/debug/nova_cli:nova:start_builtin_constructor: DataView (73461236)
usdt:/home/aapoalas/build/nova/target/debug/nova_cli:nova:stop_builtin_constructor: DataView (73467616)
usdt:/home/aapoalas/build/nova/target/debug/nova_cli:nova:start_builtin_constructor: Uint8Array (73510006)
usdt:/home/aapoalas/build/nova/target/debug/nova_cli:nova:stop_builtin_constructor: Uint8Array (73522326)
usdt:/home/aapoalas/build/nova/target/debug/nova_cli:nova:start_ecmascript_constructor: Test262Error (78858905)
usdt:/home/aapoalas/build/nova/target/debug/nova_cli:nova:stop_ecmascript_constructor: Test262Error (78932415)

@nair-sreerag
Copy link

Hi @aapoalas,
What is the reason behind changing the method of provider and probe declaration from an external file to using the #[usdt::provider] attribute?

@aapoalas
Copy link
Member Author

aapoalas commented Dec 3, 2024

Hi @aapoalas, What is the reason behind changing the method of provider and probe declaration from an external file to using the #[usdt::provider] attribute?

Colocation of definition and code: With the attribute macro I can define the probe where it is used, only making changes to a single file and in a single language. If I used the .d D language file then I'd need to change two files and use two languages.

Linux perf does not understand the probes laid down by the usdt crate.
This mostly makes sense, as usdt is made by oxidecomputer folks and they
mainly target illumos and linux distributions with DTrace available.

My assumption is that we end up with the no-action register_probes() call
and hence we get no probe information. Not sure why that is but so it is.
@aapoalas aapoalas merged commit 9ac585a into main Sep 1, 2025
4 checks passed
@aapoalas aapoalas deleted the feat/usdt-tracing branch September 1, 2025 12:02
aapoalas added a commit that referenced this pull request Sep 1, 2025
aapoalas added a commit that referenced this pull request Sep 1, 2025
aapoalas added a commit that referenced this pull request Sep 8, 2025
Enable tracing of JavaScript and builtin function calls, GC timings, and Script, Module, eval, and Job execution.
aapoalas added a commit that referenced this pull request Sep 8, 2025
Enable tracing of JavaScript and builtin function calls, GC timings, and Script, Module, eval, and Job execution.
aapoalas added a commit that referenced this pull request Sep 8, 2025
Enable tracing of JavaScript and builtin function calls, GC timings, and Script, Module, eval, and Job execution.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants